-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[emojicoin] Add fees #2140
base: master
Are you sure you want to change the base?
[emojicoin] Add fees #2140
Conversation
The emojicoin.ts adapter exports:
|
f9e4ed3
to
991d99f
Compare
The emojicoin.ts adapter exports:
|
@@ -1,22 +1,29 @@ | |||
import { httpGet } from "../utils/fetchURL"; | |||
import {httpGet, httpPost} from "../utils/fetchURL"; | |||
|
|||
export const APTOS_PRC = 'https://aptos-mainnet.pontem.network'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export const APTOS_PRC = 'https://aptos-mainnet.pontem.network'; | |
export const APTOS_RPC = 'https://aptos-mainnet.pontem.network'; |
let lastData: any; | ||
let cursor | ||
do { | ||
let url = `${APTOS_PRC}/v1/accounts/${account}/resources?limit=9999` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let url = `${APTOS_PRC}/v1/accounts/${account}/resources?limit=9999` | |
let url = `${APTOS_RPC}/v1/accounts/${account}/resources?limit=9999` |
return { | ||
totalFees: `${totalFees}`, | ||
dailyFees: `${dailyFees}`, | ||
// TODO: revenue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The revenue can just be the integrator fees (what you're already using for total/daily)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so fees = revenue?
|
||
const ONE_DAY: number = (24 * 60 * 60 * 1000); | ||
|
||
const fetch = async (timestamp: number) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change this to adapter version 2, then you get start and endTimestamp as part of input
const yesterdayRegistry = await registryView(BigInt(closestToPreviousDate)) | ||
const todayRegistry = await registryView(BigInt(closestToDate)) | ||
|
||
const prices = await getPrices(["coingecko:aptos"], timestamp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid pulling token prices and change code to something like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
bump |
No description provided.